/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package com.plian.system.service.im;

import com.plian.Tools.pagedata.PageData;
import com.plian.system.dto.im.BaseInvestmentDebtDTO;
import com.plian.system.entity.im.BaseInvestmentDebt;
import com.plian.system.model.ListResult;
import com.plian.system.model.ObjResult;
import com.plian.system.model.R;
import com.plian.system.mybatis.base.BaseService;
import com.plian.system.mybatis.support.Query;
import com.plian.system.vo.im.BaseInvestmentDebtVO;
import com.plian.system.vo.im.InvestmentDebtSummaryVO;

import javax.servlet.http.HttpServletResponse;
import java.io.OutputStream;
import java.util.List;

/**
 * 服务类
 *
 * @author
 * @since 2019-09-27
 */
public interface IBaseInvestmentDebtService extends BaseService<BaseInvestmentDebt> {


    /**
     * 每月只能填写一次
     *
     * @param baseInvestmentDebt
     * @return
     */
    String checkMonth(BaseInvestmentDebt baseInvestmentDebt);


    /**
     * 保存 包含子表
     *
     * @param baseInvestmentDebt
     * @return
     */
    boolean submit(BaseInvestmentDebt baseInvestmentDebt);

    /**
     * 获取detail obj对象
     *
     * @param baseInvestmentDebtVO
     * @return
     */
    R<BaseInvestmentDebtVO> getDetailObj(BaseInvestmentDebtVO baseInvestmentDebtVO);


    /**
     * 生成excel文件 并返回文件名  时间戳+"-"+uuid
     *
     * @param baseInvestmentDebtId
     * @return
     */
    String export(Long baseInvestmentDebtId);

    /**
     * 生成可以导入的excel文件 并返回文件名  时间戳+"-"+uuid
     *
     * @param baseInvestmentPlanId
     * @return
     */
    String exportImportFile(Long baseInvestmentPlanId);

    /**
     * excel文件下载
     *
     * @param key
     * @param response
     * @param os
     */
    void download(String key, HttpServletResponse response, OutputStream os);

    /**
     * 获取上月已填报数据
     *
     * @param baseInvestmentDebt
     * @return
     */
    R<BaseInvestmentDebtVO> getLastMonthObj(BaseInvestmentDebt baseInvestmentDebt);

    /**
     * 填报树
     *
     * @param baseInvestmentDebt
     * @return
     */
    ObjResult tree(BaseInvestmentDebt baseInvestmentDebt);

    /**
     * 获取tree列表页
     *
     * @param query
     * @return
     */
    ListResult<PageData> treeList(Query query);


    /**
     * 债务余额及结构主表填报树 新增
     *
     * @param baseInvestmentDebt
     * @return
     */
    ObjResult addTree(BaseInvestmentDebt baseInvestmentDebt);

    /**
     * 获取下级已填报数据
     *
     * @param baseInvestmentDebt
     * @return
     */
    ObjResult childList(BaseInvestmentDebt baseInvestmentDebt);

//    /** TODO DEL
//     * 根据主表id 获取合计数据
//     *
//     * @param baseInvestmentDebt
//     * @return
//     */
//    ObjResult childSummary(BaseInvestmentDebt baseInvestmentDebt);

//    /**
//     * 项目信息导入
//     *
//     * @param progressId
//     * @param inputStream
//     * @return
//     */
//    Future<ImportResult> importExcel(String progressId, InputStream inputStream);

    /**
     * 导入模板下载
     *
     * @param response
     * @param os
     */
    void exportTemplateExcel(HttpServletResponse response, OutputStream os);

    /**
     * 国有企业投资项目债务余额及结构汇总表(国资汇总)
     *
     * @param baseInvestmentDebtDTO
     * @return
     */
    List<InvestmentDebtSummaryVO> summary(BaseInvestmentDebtDTO baseInvestmentDebtDTO);

//    /**
//     * 国有企业投资项目债务余额及结构汇总表(国资汇总) 导出
//     *
//     * @param baseInvestmentDebtDTO
//     * @return
//     */
//    String summaryExport(BaseInvestmentDebtDTO baseInvestmentDebtDTO);

}
